/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Graph;

import java.util.ArrayList;
import java.util.Iterator;

/**
 *
 * @author Andrew
 */
public class Bag implements Iterable<Node> {
    private ArrayList<Node> nodes;

    public Bag(ArrayList<Node> nodes) {
        this.nodes = nodes;
    }

    /**
     * Returns the nodes within this bag. This is not
     * copy, thus changes to the list will affect the
     * state of this object.
     *
     * @return - The nodes
     */
    public ArrayList<Node> getNodes() {
        return nodes;
    }

    public Iterator<Node> iterator() {
        return nodes.iterator();
    }
}
